System and method for identifying upper layer protocol message boundaries

ABSTRACT

Systems and methods that identify the Upper Layer Protocol (ULP) message boundaries are provided. In one example, a method that identifies ULP message boundaries is provided. The method may include one or more of the following steps: attaching a framing header of a frame to a data payload to form a packet, the framing header being placed immediately after the byte stream transport protocol header, the framing header comprising a length field comprising a length of a framing protocol data unit (PDU); and inserting a marker in the packet, the marker pointing backwards to the framing header and being inserted at a preset interval.

RELATED APPLICATIONS

This application makes reference to, claims priority to and claims benefit from U.S. Provisional Patent Application Ser. No. 60/363,381, entitled “Method of Identifying ULP Header in TCP Stream,” filed on Mar. 8, 2002; U.S. Provisional Patent Application Ser. No. 60/363,356, entitled “Method of Identifying ULP Header in TCP Stream,” filed on Mar. 11, 2002; U.S. Provisional Patent Application Ser. No. 60/372,852, entitled “Method for Marker Based Re-Segmentation Detection,” filed on Apr. 16, 2002; and U.S. Provisional Patent Application Ser. No. 60/372,851, entitled “Method for Marker Based Re-Segmentation Detection,” filed on Apr. 16, 2002.

INCORPORATION BY REFERENCE

The above-referenced United States patent applications are hereby incorporated herein by reference in their entirety.

BACKGROUND OF THE INVENTION

The transmission control protocol/internet protocol (TCP/IP) is a protocol that has become widely used for communications. However, receiving, buffering, processing and storing the data communicated in TCP segments can consume a substantial amount of host processing power and memory bandwidth at the receiver. In a typical system, reception includes processing in multiple communications layers before the data is finally copied to its final destination an Application buffer. A typical network interface card (NIC) processes the Layer 2 headers (e.g., ethernet headers) and then copies the remaining headers (e.g., Layer 3 and higher headers) and/or the Upper Layer Protocol (ULP) payload to a transport buffer (e.g., a TCP buffer) for networking and transport layer processing. The transport and networking processing (e.g., TCP/IP where TCP is the transport layer protocol) removes the Layer 3 and Layer 4 headers and copies the remaining headers and ULP payload to another buffer. This process repeats in the next level until the last header is removed and the ULP payload is copied to the buffer assigned by the application. Most of the bytes in the frames are payload (e.g., data), but it is copied again and again as the control portion of the frames (e.g., the headers) is processed in a layered fashion. The host CPU, which incurs high overhead of processing and copying including, for example, handling many interrupts and context switching, does this. Thus, very few cycles are available for application processing, which is the desired use of a server machine. For high-speed networking (e.g., 10 Gigabits per second), the additional copying strains the memory sub-system of the computer. For an average of three data copies, the memory subsystem of most commercially available server computers becomes a bottleneck, thereby preventing the system from supporting 10 Gigabit network traffic. Since TCP/IP is the dominant transport protocol used by most applications today, it would therefore be useful to ease the burden of this processing to achieve, for example, scalable low CPU utilization when communicating with a peer machine.

What is needed to reduce the overhead is to ensure data is copied once from the wire to the application buffer. A problem is that the NIC has no idea what portion of a received frame is, for example, ULP data and what portion is ULP control. What is needed is to have the sender build the frames in a way that makes it easy for the receiver NIC to make this distinction. However, each ULP protocol may have its own way of mixing data and control, thereby making it very difficult to build a NIC that supports them all.

Another problem is that TCP offers a byte stream service to the ULP. It is not always possible to tell the beginning of a ULP message (e.g., the protocol data unit (PDU)) inside that endless stream of bytes (e.g., the TCP data). Assuming that the frames arrive without resegmentation at the receiver (e.g., a server), the receiver may unpack the frame using TCP and might be able to locate the ULP header. The ULP header may include, for example, control information that may identify a location in the application buffer where the ULPDU may be directly placed. However, even if a sender could somehow be adapted to employ, in every TCP segment, a TCP layer adapted to place ULP control information starting in the first payload byte of the TCP segment, it might not be enough. This is because resegmentation is not uncommon in TCP/IP communications. There is no guarantee the TCP segments will arrive on the other end of the wire, the way the sender has built them because, for example, there may be network architectural structures between the sender and the receiver. For example, an intermediate box or middle box (e.g., a firewall) may terminate the TCP connection with the sender and, without the sender or the receiver being aware, may initiate another TCP connection with the receiver. The intermediate box may resegment the incoming frames (e.g., use a smaller TCP payload). Thus, a single frame may enter the intermediate box, but a plurality of smaller frames, each with its own TCP header may exit the intermediate box. This behavior by the middle box may disrupt the nicely placed control and data portions.

In the case of resegmentation, the receiver may face a number of challenges. For example, the receiver may not be aware that there are any intermediate boxes between the sender and the receiver. In addition, the initial segmenting scheme used by the sender may not be the segmenting scheme received by the receiver. Thus, although the receiver may be able to order the smaller frames, the receive may be unable to locate, for example, the ULP header and the ULPDU. Accordingly, the receiver may not be able to ascertain the control and boundary information that may be necessary to correctly place the ULPDU in the proper location of, for example, the application buffer of the receiver.

Another problem is that TCP/IP networks may deliver segments out of order. The ULP may have a PDU larger than one TCP segment, which may be limited to 1460 bytes when used on top of the ethernet, and the ULPDU may be split among a plurality of TCP segments. Therefore, some TCP segments may contain, for example, only data and no control information that may instruct the receiving NIC as to where to place the data. The receiver is faced with a choice of dropping the out-of-order segments and requesting a retransmission, which is costly in terms of delay and performance loss, or buffering the out-of-order segments until all the missing segments have been received. Some implementations may choose to accumulate all the out-of-order segments, to wait for the missing TCP segments to be received and then to place them in order. The receiving NIC may then process the whole set of TCP segments, as it uses the control portion to obtain data placement information. This process adds the cost for the temporary buffer and uses high power CPU and wider data path than otherwise. The receiving NIC processes all the accumulated TCP segments in parallel to process other TCP segments at wire speed since traffic on the link continues all the time. The out-of-order segments may create a “processing bubble” for the receiver.

A proposed solution for locating the ULP header is to use the TCP ULP framing (TUF) protocol. According to the TUF protocol, a sender places a special value (i.e., a key) within the TCP segment as the first byte following the TCP header as illustrated in FIG. 1. The key may be a unique value (e.g., a particular 48-bit value) for which the receiver may search. Accordingly, when the receiver finds the key, the receiver has also found, for example, the ULP header or the beginning of the control information (e.g., the first byte of the DDP/RDMA header). However, the TUF protocol has a probabilistic nature. For example, the unique value may occur by accident within the ULPDU. Furthermore, in the face of, for example, resegmentation or TCP retransmission (e.g., from an improper TCP sender) the receiver may misidentify the beginning of the control information, resulting in the silent corruption of the data due to placement in the wrong host memory location. Although the unique value can be increased in length to reduce such a misidentification event, the probability always exists. The key may also present a security risk if an unauthorized receiver is able to obtain the unique value allowing the unauthorized receiver to access the ULP payload.

Another solution to locating a particular header is to use a fixed interval markers (FIM) protocol. The FIM protocol uses only forward-pointing markers and has been limited to internet small computer system interface (iSCSI) applications. In the FIM protocol, a forward-pointing marker is placed in a known location inside the TCP byte stream. This enables the receiver to possibly locate it in the endless TCP byte stream. The FIM marker points forward to the beginning of the iSCSI header as shown in FIG. 2. The marker is placed, by default, every 8192 bytes, although this is negotiable. However, the FIM protocol may have a disadvantage, because the marker is placed only sparingly, every 8192 bytes. Accordingly, a lot of frames may need to be buffered before or if the iSCSI header is to be identified. Other iSCSI headers may have no FIM marker pointing to them such that the receiver has to process the TCP segments in order to be able to place the iSCSI data. The FIM protocol also does not provide a guarantee that the iSCSI header is located following the TCP header or that the iSCSI header is even placed in its entirety in one TCP segment. To use the FIM protocol, the receiver has to store locally the TCP sequence location pointed to by that FIM. It uses this when the TCP segment with that location is received (i.e., additional state information for every FIM received is stored until the corresponding TCP segment with the iSCSI header is received). The FIM protocol does not provide any suggestion or teaching as to the processing of out-of-order TCP segments if the received out-of-order TCP segments are less than the FIM distance (e.g., 8192 bytes in the default). The FIM protocol is also limited to iSCSI applications and may not provide a generic solution for the framing problem that may be needed by all applications using high speed TCP/IP protocol.

Further limitations and disadvantages of conventional and traditional approaches will become apparent to one of ordinary skill in the art through comparison of such systems with some aspects of the present invention as set forth in the remainder of the present application with reference to the drawings.

BRIEF SUMMARY OF THE INVENTION

Aspects of the present invention may be found in, for example, systems and methods that identify an Upper Layer Protocol (ULP) message boundaries. In one embodiment, the present invention may provide a method that identifies ULP message boundaries. The method may include one or more of the following steps: attaching a framing header of a frame to a data payload to form a packet, the framing header being placed immediately after the byte stream transport protocol header, the framing header comprising a length field comprising a length of a framing PDU; and inserting a marker in the packet, the marker pointing backwards to the framing header and being inserted at a preset interval.

In another embodiment, the present invention may provide a method that locates a marker header in a received TCP frame. The method may include one or more of the following steps: locating a backwards-pointing marker; and using information stored in the backwards-pointing marker to locate the framing header.

In another embodiment, the present invention may provide a method that detects resegmentation of a TCP segment. The method may include one or more of the following steps: locating a backwards-pointing marker in the TCP segment; determining a location of a framing header using information stored in the backwards-pointing marker; and determining that resegmentation of the TCP segment has occurred if the framing header is not at the front of the TCP segment after a TCP header of the TCP segment.

In another embodiment, the present invention may provide a method that detects resegmentation of a TCP segment. The method may include one or more of the following steps: locating a backwards-pointing marker in the TCP segment; determining a location of a framing header using information stored in the backwards-pointing marker; and determining that resegmentation of the TCP segment has occurred if the backwards-pointing marker points to a location outside of the TCP segment.

In another embodiment, the present invention may provide a method that detects resegmentation of a TCP segment. The method may include one or more of the following steps: locating a backwards-pointing marker in the TCP segment; determining a location of a framing header using information stored in the backwards-pointing marker; and determining that resegmentation of the TCP frame has occurred if a number of payload bytes in the TCP segment is not equal a number indicated by a framing header length field plus a pad and a CRC field.

In another embodiment, the present invention may provide a method that detects resegmentation of a TCP segment. The method may include one or more of the following steps: locating a backwards-pointing marker in the TCP segment; determining a location of a framing header using information stored in the backwards-pointing marker; and determining that resegmentation of the TCP frame has occurred if a number of payload bytes in the TCP segment is not equal to a sum of all values of a framing header length fields plus pads and CRC fields for multiple framing PDUs placed in a TCP segment.

In yet another embodiment, the present invention may provide a method that detects a potential error in a byte stream transport protocol segment by comparing a received error detection code with a computed error detection code over a framing PDU. The method may include one or more of the following steps: if the comparing occurs before byte stream transport protocol processing, then discarding received segment and relying on the byte stream transport recovery protocol without need for specific framing layer recovery; if the comparing occurs after the byte stream transport protocol processing, then tearing down connection; and allowing for additional protection beyond the byte stream transport checksum protocol.

In yet another embodiment, the present invention may provide a method in which no information is stored from one TCP segment to allow the processing of another TCP segment.

In yet another embodiment, the present invention may provide a method that provides additional protection of a marker by attaching, to the marker, 16 bits of error detecting code such as a cyclical redundancy checking (CRC), for example, CRC16.

In yet another embodiment, the present invention may provide a method that allows additional information to be carried in the reserved bits (e.g., 16 reserved bits) of the Marker. For example, this can be another marker for a ULP specific purpose or any other useful data that can be carried in a sequence of these 16 bit entities. For example, the reserved field can be used for signaling between 2 ULPs.

In some embodiments, the present invention may define a framing protocol that enables the receiver to identify the beginning of ULP control and data portions embedded in the TCP/IP byte stream. Every TCP segment may be self-describing to allow data placement when received in order or out of order. Layered on top of the framing protocol may be, for example, a direct data placement/remote direct memory access (DDP/RDMA) protocol header. The DDP/RDMA header may carry the information as to the buffer to be used and offset into that buffer. Once the receiver finds the DDP/RDMA field, it may tell the control and data portions apart and place the ULP data without processing the protocol specific control information. The upper layer (UL) may form a ULP packet by placing ULP control information or a ULP data unit (ULPDU) as a payload for the Lower Layer Protocol (e.g., RDMA/DDP). The RDMA/DDP PDU may be placed into a framing PDU. The TCP layer may form a TCP segment by attaching a TCP header to the ULP/RDMA/DDP/framing packet. The packets may pass through other layers of the protocol stack (e.g., the ethernet layer) before being placed on a data link (e.g., a wire) as frames by the sender (e.g., a client).

These and other features and advantages of the present invention may be appreciated from a review of the following detailed description of the present invention, along with the accompanying figures in which like reference numerals refer to like parts throughout.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows an example of the TUF protocol.

FIG. 2 shows an example of the FIM protocol for use with iSCSI.

FIG. 3 shows an embodiment of a system that may provide frame marking according to the present invention.

FIG. 4 shows an embodiment of a TCP frame according to the present invention.

FIG. 5 shows an embodiment of a TCP frame according to the present invention.

FIG. 6 shows an embodiment of a TCP frame according to the present invention.

FIG. 7 shows an embodiment of a marker header and trailer format according to the present invention

FIG. 8 shows an embodiment of a marker format according to the present invention.

FIGS. 9A-B show a flowchart of an embodiment of a process for marking frames according to the present invention.

FIGS. 10A-D show a flowchart of an embodiment of a process for receiving TCP frames according to the present invention.

FIG. 11 shows an embodiment of the resegmentation of a TCP frame according to the present invention.

FIGS. 12A-D show embodiments of special marker locations according to the present invention.

FIG. 13 shows an embodiment of a process that detects resegmented TCP segments according to the present invention.

DETAILED DESCRIPTION OF THE INVENTION

FIG. 3 shows an embodiment of a system that may provide a method for identifying Upper Layer Protocol (ULP) message boundaries. For example, the method may identify ULP message boundaries in a byte stream transport protocol (e.g., a framing protocol). A transmitter 10 (e.g., a client) may be coupled to a receiver 30 (e.g., a server) via a network 20 such as, for example, the internet. The network 20 may optionally include an intermediate box 40. A TCP connection may be initiated between the transmitter 10 and the receiver 30. The intermediate box 40 (e.g., a firewall) may terminate the TCP connection of the transmitter 10 and may initiate another TCP connection with the receiver 30. The intermediate box 40 may receive a first set of TCP frames from the transmitter 10 and resegment the first set of TCP frames into a second set of TCP frames. The resegmentation of the first set of TCP frames may, for example, result in smaller TCP frames. In such a case, the TCP frame scheme sent by the transmitter 10 may not be the TCP frame scheme received by receiver 30.

FIGS. 4 and 5 show embodiments of TCP frames according to the present invention. The TCP frame 50 may include, for example, a TCP header 60; a framing header 70; one or more markers 80; a framing trailer 90 possibly including, for example, a pad or a cyclical redundancy checking (CRC); and a payload 100 that may include, for example, ULP data. FIG. 4 shows an embodiment in which one marker 80 is inside the TCP frame 50 and FIG. 5 shows an embodiment in which two markers 80 are inside the TCP frame 50. Although shown with one or two markers 80 inside the TCP frame 50, zero, three or more markers may be present inside the TCP frame 50. The TCP header 60 may be a conventional TCP header 60 and may provide, for example, location information within the TCP sequence number space. The CRC 90 may optionally be employed for error detection. The CRC 90 may cover, for example, the framing header 70, the one or more markers 80, the payload 100 and the pad, if present. Other types of error detection or error correction may also be used instead of or in addition to the CRC 90. For example, the CRC may use CRC-32 c.

The framing header 70 (e.g., a marker header) may be disposed after the TCP header 60. In one embodiment, the framing header 70 generally must follow immediately after the last byte of TCP header 60, which may include any potential TCP options, in the TCP frame 50. The sender 10 may guarantee that all TCP segments (including retransmissions) have the framing header 70 as the first byte immediately following the TCP header (plus options if used). The framing header 70 may include information such as, for example, data information or control information (e.g., ULP control information). The framing header 70 may also provide information relating to boundaries of the payload 100 corresponding to the framing header 70. In addition, the ULP header 110 may include specific information as to which memory (e.g., an application buffer) and, specifically, where in the memory of the receiver 10 the payload 100 should be placed (e.g., stored). The ULP header 110 may include, for example, a DDP/RDMA header/trailer or other types of ULP headers/trailers. FIG. 6 shows an embodiment of a TCP frame 50 that includes the framing header 70 and a separate DDP/RDMA header 110.

FIG. 7 shows an embodiment of a marker header format according to the present invention. A payload length may indicate the length in bytes of the ULPDU contained in the TCP segment. It might not include the length of the framing header itself, the pad, the CRC or any markers that may be present in the framing PDU. The ULPDU may be, for example, the ULP data (or the ULP control). The pad may provide, for example, up to three bytes to make the frame a modulo 4 byte in length. The CRC may be, for example, a CRC-32 c. In one example, the total length in bytes of the ULPDU and framing headers and trailer placed inside the TCP packet may be payload length plus the length of the CRC (e.g., 4 bytes for CRC-32 c) plus the number of pad bytes.

There may be multiple framing PDUs inside one TCP segment. Each of them may be processed independently by the receiver 30.

The marker 80 is generally a backward pointing marker. The marker 80 may point backwards to the beginning of the framing header 70, thereby identifying the framing header 70. If more than one marker 80 is present in the TCP frame 50, then one or more markers may point backwards to the same framing header 70 as shown in FIG. 5. In one embodiment, all of the markers 80 in the TCP frame 50 point to the framing header 70. Thus unlike the TUF protocol, the identification of the ULP message boundary (e.g., beginning of the framing header) is fully deterministic and is not subject to any probabilistic failure. Thus, unlike the FIM protocol, buffering may be minimized since every TCP segment that carries a marker 80 is self descriptive and allows the receiver 30 to locate the buffer placement information carried inside that segment, for example, in the ULP header 110. The marker 80 can be used to derive the buffer placement information placed, for example, in the ULP header, whether the TCP segment has been received in order or out of order. A TCP segment may be received in order, for example, if all the previous TCP segments with lower TCP sequence numbers that can be legally received are within the TCP “window”. Even a TCP segment that has been received out of order, but carries a marker 80, can be processed for placing the ULP data it contains since the marker 80 points to the framing header 70. From the framing header 70, the receiver 30 may detect the ULP header 110 that may contain the buffer information. The TCP header may be processed separately according to the TCP protocol.

The marker 80 may be placed in the TCP stream at a preset interval by the transmitter 10. For example, the marker 80 may be placed every 512 bytes in the TCP stream. If the preset interval is small enough (e.g., smaller than smallest transport segment), then a marker may be present in almost every TCP segment 50 or in every TCP segment 50. If the TCP segment is shorter than the preset interval, then there is no guarantee a marker will be present in the TCP segment. If a marker 80 is still present in the short TCP frame 50 (e.g., a TCP segment shorter than the preset interval), then the framing header 70 may be located and the TCP segment 50 may be processed as described above (e.g., the payload 100 may be directly placed in the proper location within the application buffer). If, on the other hand, a marker 80, is not present the receiver 30 may still place the payload 100 inside the TCP segment according to information that may be in the ULP header 110, if the TCP segment has been received in order (e.g., all previous TCP segments with lower TCP sequence number that can be legally received, for example, are within the TCP window, have been received). In this case, even if an intermediate box is present and it has resegmented the TCP byte stream, this segment can still be processed. This is due to the fact that the previous segments were processed and, if there was no error, then it is known that next byte placed by the sender in the TCP byte stream is the first byte of the framing header 70. Another case occurs when the TCP segment is received out of order with no marker. In this case, the receiver places the TCP segment it has received in a temporary buffer (or drops the TCP segment and processes only in order), thereby eliminating any need for a buffer with a slight performance degradation. The buffer size may be small and may be calculated approximately as, for example, the preset interval multiplied by the number of TCP holes the receiver wants to support per every TCP connection. In contrast, the FIM protocol requires a buffer size of the FIM interval plus a maximum transmission unit (MTU) multiplied by the number of TCP holes and the data contained in the marker for every marker, multiplied by the number of TCP connections. The receiver may statistically set aside fewer resources since not all connections may experience out of order TCP segments at the same time. If the receiver runs out of buffer for out-of-order TCP segments, the receiver may drop all subsequent TCP segments received out of order, until some of the buffer has been freed due to, for example, the plugging of holes in the TCP stream.

The TCP frames 50 may be self-descriptive. In addition, unlike the FIM protocol, the receiver 30 does not necessarily have to carry state information from one frame to another frame. Since most every TCP frame 50 may include a marker 80, then most every TCP frame 50 may be processed independently. Independent processing of the TCP frames 50 may substantially reduce buffering needs, especially in a TCP environment in which TCP frames 50 may be out of order upon reaching the receiver 30.

Placing the marker 80 at a preset interval may also provide the receiver 30 with known locations in the TCP stream in which to find the marker 80. Thus, the relative location of the marker 80 with respect to the TCP header 60 may vary from TCP frame 50 to TCP frame 50. The receiver 30 may determine location information within the TCP sequence number space from the TCP headers 60. In one example in which the marker 80 is placed every 512 bytes in the TCP stream, the receiver 30 may perform a modulo 512 operation to locate the marker 80. As the TCP sequence space may start from a non-zero value, which may vary from one TCP connection to another TCP connection, the preset interval may be calculated by subtracting the initial non-zero value from the TCP sequence number carried inside the TCP header and performing a modulo 512 on the result. Unlike the FIM protocol, the ability to start using the framing protocol without negotiation eliminates any additional latencies in getting the two machines to communicate with the benefits of a framing protocol. It may also save on the additional code that may need to be written and stored on the NIC to perform the negotiation.

The present invention also contemplates that, instead of the preset interval, the transmitter 10 and the receiver 30 may negotiate an interval. Furthermore, out-of-band communications may be used to adjust the marker interval. The value of the marker interval may be adjusted by the ULP at some time after initialization. This may allow a balance between wire protocol overhead and receiver side resegmentation buffer size per connection.

FIG. 8 shows an embodiment of a marker format according to the present invention. In one embodiment, the marker is 32 bits in length. The first 16 bits (MSB) may indicate the offset to the beginning of the framing header 70. The 16-bit marker may be interpreted as a 16-bit unsigned integer that carries the number of bytes in the TCP sequence space from the first byte of the framing header 70 to the marker 80. For example, if the initial TCP sequence space starts at byte 12 and the current TCP segment has the first payload byte located at byte 112 in the TCP sequence space. The next marker may be located at the 32-bit field located in byte 524, assuming a marker interval of 512 bytes, in the TCP sequence space. The marker may have the value of 412 (i.e., subtract 112 from 524). In one embodiment, since the fields of the TCP segment formatted for framing are 4-byte aligned, the last 2 bits of the marker are zeroes. The next 16 bits (LSB) may be reserved for another framing (e.g., NFS) or other another signaling function. In one embodiment, the next 16 bits (LSB) may be a repeat of the first 16 bits. In another embodiment, the next 16 bits (LSB) may carry error correction or error detection code (e.g., CRC-16) to protect the contents of the marker. In yet another embodiment, the next 16 bits (LSB) may carry ULP specific information and serve a communication channel between the ULPs or be used to point to some ULP specific field (e.g., a second marker pointing to an NFS header for example). In another embodiment, the 16-bit fields may be swapped. Unlike the FIM protocol, the overhead of the marker may be only 32 bits. The FIM protocol has 2 copies of the same marker each occupying 32 bits as the interval between markers may be long and a middle box may resegment in the middle of one marker. One embodiment of the present invention may, for example, require only one copy of the marker.

In operation, the transmitter 10 may employ a protocol stack that includes upper layers (ULs) as well as, for example, TCP/IP layers in forming the TCP frames 50. FIGS. 9A-B show a flowchart of an embodiment of a process for marking frames according to the present invention. In step 120, a TCP connection may be formed, for example, between the transmitter 10 and the receiver 30. In step 130, the transmitter 10 may place the framing header 70 inside the TCP segment immediately following the TCP header. In step 140, a DDP/RDMA header may be placed in the TCP segment immediately following the framing header 70. In one example, the transmitter 10 may attach a DDP/RDMA header/trailer 110 before attaching the framing header 70. In step 150, the sender 10 may get the ULPDU length and segment it to fit inside one TCP segment. Next the sender 10 may compute the location and content of the one or more markers. In step 160, the sender 10 may compute the location of the next marker, for example, by adding the preset interval to the location of last marker. In step 170, the sender 10 may check to see whether the next marker 80 falls inside the boundaries of the TCP segment. This step may take consider, for example, the maximum transmission unit for the TCP segment and the amount of ULPDU data to be transmitted. If the next marker falls outside the boundaries of the TCP segment, then, in step 210, the sender 10 may place the ULPDU data starting immediately after the framing header 70 and the DDP/RDMA header 110, if present (while skipping the one or more markers). If the next marker falls inside the TCP segment, then, in step 180, the sender 10 may check if the next marker falls immediately after the TCP header. If the next marker immediately falls after the TCP header, then, it is placed immediately after the TCP header and before the framing header 70. In step 190, the marker value is set to 0 (i.e., the framing header immediately follows this marker). Then, in step 160, the sender 10 may see whether more markers are to be placed. In query 180, if the next marker is not immediately after the TCP header, then, in query 200, the sender 10 may determine whether the next marker falls in the next byte after the location of the CRC field. If the next marker falls in the next byte after the location of the CRC field, then, in step 220, the marker is not placed. In step 210, since the last marker has been placed, the ULPDU may be placed and the CRC may be computed and placed. If the marker 80, doe not immediately fall after the CRC field, then it falls inside the TCP segment. In step 230, the marker 80 is computed and placed and the process loops back to step 160 to find the location of the next marker 80 in the TCP segment. After all the markers 80 have been placed by the sender 10, then query 170 may proceed to step 210. In step 210, since the last marker has been placed, the ULPDU may be placed around the markers and the CRC may be computed and placed. The CRC may cover the complete framing PDU from the first byte immediately following the TCP header to the last byte of the pad, if present, or the ULPDU data. The CRC computation may be attached at the end of the frame to form the TCP frame 50. Although described in a particular order, the steps may be arranged in a different order and some steps may occur concurrently or may be left out. For example, the marker 80 may be inserted before or concurrently with the attaching of the TCP header 60. Unlike the FIM protocol, the CRC covers the markers enabling, for example, a very simple receiver in which the whole TCP payload except for the last 4 bytes (assumed to be the CRC) is subject to CRC computation. The FIM protocol mechanism requires locating the markers and excluding them from CRC computation, which is a more cumbersome and expensive operation.

The sender 10 may be aware of the path maximum transmission unit (PMTU) and how it may change. The TCP layer variable maximum segment size may be affected by the PMTU. When retransmitting, per the TCP requirements, the sender 10 may segment the byte stream in the same way the original framing PDU has been segmented (e.g., first byte of the framing header to follow the TCP header, the length of the TCP segment may include one complete framing PDU or several complete framing PDUs). The PMTU may change between the first transmission and the retransmission. The sender 10 may still create the TCP segment the it did the first time. If the PMTU has shrunk, then the original segment size may exceed the allowed PMTU. A lower layer mechanism such as, for example, IP fragmentation, may be employed.

In a network in which the PMTU is too small to allow proper operation, the sender 10 may follow an “emergency mode” as outlined in the TUF protocol. The TUF protocol is described, for example, in “TCP ULP Framing Protocol (TUF): draft-ietf-tsvwg-tcp-ulp-frame-01” by Bailey et al. The above-referenced document is hereby incorporated herein by reference in its entirety.

The transmitter 10 may then send the TCP frame 50. FIGS. 10A-D show a flowchart of an embodiment of a process for receiving the TCP frames 50 according to the present invention. In step 240, the TCP frame 50 may be received by the receiver 30. The TCP segment may be in order (e.g., the next expected segment in the TCP sequence number space) or out of order (e.g., a TCP segment that is to the right of the left edge of the TCP Window). In step 250, the receiver 30 may then locate the marker 80 in the TCP frame 50. The receiver 30 may obtain TCP sequence number information from the TCP header for the TCP frame 50. In addition, to locate the marker 80, the receiver 30 may subtract the initial non-zero value of the TCP sequence number for the first TCP payload byte in that particular TCP stream. The receiver 30 may then perform a modulo operation on the TCP sequence numbers using the preset interval at which the marker 80 is located. The receiver 30 need not locate all markers, if more than one is present, since using the one marker may be sufficient. In query 260, the receiver 30 may determine whether a marker is present inside the TCP segment 50. If present, then, in step 270, the receiver 30 may locate the framing header 70 using the information stored in the marker 80. In one example, the marker 80 may be a backward pointer in which a delta value is stored in the marker 80. The delta value may indicate the location of the framing header 70 by indicating the number of bytes backwards from the TCP sequence number of the marker 80 to the TCP sequence number of the beginning of the ULP header 70. In step 280, the receiver 30 may obtain the framing PDU length from the length field inside the framing header 70. In step 290, the receiver 30 may compute the CRC over the whole framing PDU and compare it to the value received in the CRC field of that framing PDU. In query 300, the receiver 30 may determine whether the CRC is valid. If CRC matches, then, in step 310, the receiver 30 may obtain control information and/or data information from the framing header 70 and/or DDP/RDMA header 110. In step 320, the receiver 30 may perform the operation requested in accordance with the control information and/or data information. For example, the DDP/RDMA header 110 may include ULP control information. In another example, the DDP/RDMA header 110 may include boundary information about the ULP payload. In yet another example, the DDP/RDMA header 110 may indicate in which memory (e.g., a particular application buffer) and in which location within the memory the ULPDU data should be directly placed. The receiver 30 may use the framing header length field to see, for example, if a pad is present (i.e., if the length is not an integer multiple of 4 bytes). The receiver 30 may place the ULPDU data in that memory location with out placing the pad bytes (e.g., 0-3 bytes). In query 300, if the CRC does not match per the check done by the receiver 30, then, in query 360, the receiver 30 may determine whether the TCP layer processing has been done for the particular segment, which may be the case for layered implementation with no change to the TCP. If the TCP processing is done for that TCP segment 50, then, in step 370, the receiver 30 may tear down the TCP connection. There may be no way to recover from this error that has been detected by the stronger CRC employed by the framing layer, but that may have slipped through the less rigorous test of the TCP checksum. In query 360, if the framing layer CRC check takes place before the TCP layer processing is done (e.g., a NIC implementing ethernet and IP and TCP and framing where local optimization can be made without breaking conformance to IETF RFCs), then, in step 380, the receiver 30 may silently drop the TCP segment and allow the TCP layer recovery mechanisms to retransmit it. This may reduce or eliminate the need to add error recovery mechanisms in the framing layer (unlike the complex error recovery mechanisms employed by iSCSI), while allowing the framing layer to enjoy the increased integrity of payload protected by CRC.

If the TCP frames 50 are shorter than the preset marker interval of, for example, 512 bytes, then it is possible that the TCP frame 50 may not contain the marker 80. In query 260, he receiver may determine whether the marker is present in the TCP segment. If a marker is not present, then, in query 330, the receiver 30 may determine whether that TCP segment 50 is received in order. If the TCP segments are received in order, then there is no need for buffering and it may be processed right away. In step 340, the receiver 30 may assume, for example, that the framing header begins in the first byte immediately following the TCP header. The process may then loop back to step 280. In query 330, if the TCP segments are received out of order, then, in step 350, the receiver may use limited buffering of approximately 512 bytes since, for example, there may be no more than 512 bytes worth of TCP segments that carry no marker for every hole in the TCP sequence. Once the TCP “hole” is plugged and all previous TCP segments have been processed and found to be error free, the receiver may continue in step 340. If the TCP frames 50 are not received in order and if the receiver 30 may desire to support more than one “hole” in the TCP sequence number space, then additional buffering may be employed (e.g., 512 bytes for every “hole”).

The marker 80 may also be used to detect resegmentation of the TCP frames 50. FIG. 11 shows an example of the resegmentation of the TCP frame 50 into two TCP frames 50A, 50B according to the present invention. In this example, the framing header 70 may be in the first TCP frame 50A and the marker 80 may be in the second TCP frame 80. When the receiver 30 locates the marker 80, it may determine the location of the framing header 70. However, if the location of the framing header 70 is not in the TCP frame 50B, then the receiver 30 may determine that resegmentation has occurred. An intermediate box 40, for example, may have resegmented the TCP frames 50 from the transmitter 10. If the location of the framing header 70 is in the TCP frame 50B, but is not at the beginning of the TCP frame 50B (i.e., the framing header 70 was not right after the TCP header 60), then the receiver 30 may determine that resegmentation has occurred. In one embodiment, if resegmentation has occurred, then the receiver 30 may not offer the expedited accelerated services such as, for example, direct data placement. In another embodiment, the receiver 30 may use the marker 80 to reconstruct the TCP segments as transmitted initially by the sender 10 (i.e., to find the framing header and use the information embedded in it and in the DDP/RDMA to find the information placed by the ULP) and to perform all the services as for normal reception. As shown by FIG. 13, another method the receiver 30 may use to detect resegmentation is that marker 80, is not present in its entirety in the received TCP segment. As shown by FIG. 13, the length field of the framing header 70, may also be used by the receiver 30, to detect that the TCP segment contains one (or more) complete framing PDUs. The receiver 30 may identify a resegmentation by finding the framing header 70, not immediately following the TCP header 60, or in case the TCP segment contains more or less bytes than indicated by the length field of the framing header (see e.g., FIG. 7). If more bytes are found, the receiver 30 may treat the bytes immediately following the CRC as the framing header of the next framing PDU (i.e., more than one framing PDU has been packed into one TCP segment). If the last byte of the last framing PDU (e.g., its CRC field) is not the last byte of the TCP segment payload, then a resegmentation has occurred.

FIGS. 12A-D show embodiments of special marker locations according to the present invention. FIG. 12A shows an example of a TCP frame 50 in which the marker 80, if placed at its preset interval, would be located immediately after the CRC 90. In one embodiment, the marker 80 may be part of the current frame and may point backwards to the framing header 70 of the current frame. FIG. 12B shows another solution to the problem of the marker 80 being placed immediately after the CRC 90 as shown in FIG. 12A. In this example, the marker 80 may be moved to the front of the next TCP frame between the TCP header 60 and the framing header 70. The marker 80 may then point forwards to the framing header 70 (and have a value of 0). FIG. 12C shows an example in which the marker 80 is placed in the middle of the ULP header (e.g., DDP/RDMA header 110). This case may pose no special problems since the marker may still effectively point to the beginning of the framing header 70. FIG. 12D shows an example in which the marker 80 is placed in the middle of the CRC 90. Since both the marker 80 and the CRC 90 may include, for example, four aligned bytes, this example may not be allowed.

While the present invention has been described with reference to certain embodiments, it will be understood by those skilled in the art that various changes may be made and equivalents may be substituted without departing from the scope of the present invention. In addition, many modifications may be made to adapt a particular situation or material to the teachings of the present invention without departing from its scope. Therefore, it is intended that the present invention not be limited to the particular embodiment disclosed, but that the present invention will include all embodiments falling within the scope of the appended claims. 

1-37. (canceled)
 38. A method for identifying Upper Layer Protocol (“ULP”) messages in a transport layer byte stream, the method comprising: forming a transport layer frame of the transport layer byte stream by, at least in part, attaching a framing header to a data payload of the transport layer frame, the framing header being attached at a location in the transport layer frame immediately after a transport protocol header of the transport layer frame; and inserting a marker in the transport layer frame, the marker pointing backwards to the framing header and being inserted at a preset interval.
 39. The method of claim 38, wherein the preset interval is a preset interval in the transport layer byte stream.
 40. The method of claim 38, wherein the preset interval is smaller than a smallest size of a transport layer packet in the transport layer byte stream.
 41. The method of claim 38, further comprising determining the preset interval by, at least in part, negotiating with a receiver of the transport layer byte stream.
 42. The method of claim 38, further comprising: initializing the preset interval; and after initializing the preset interval, adjusting the preset interval by the Upper Layer Protocol.
 43. The method of claim 38, wherein inserting a marker in the transport layer frame comprises inserting the marker in the transport layer frame, where the relative location between the inserted marker and the transport protocol header of a transport layer frame may vary between different transport layer frames.
 44. The method of claim 38, wherein inserting a marker in the transport layer frame comprises inserting the marker at a location in the transport layer frame immediately after the transport protocol header and before the framing header.
 45. The method of claim 38, wherein inserting a marker in the transport layer frame comprises inserting the marker at a location in the transport layer frame immediately following the framing header.
 46. The method of claim 38, wherein inserting a marker in the transport layer frame comprises inserting the marker between headers in the transport layer frame, and further comprising inserting a second marker in a data payload portion of the transport layer frame, the second marker point backwards to the framing header and being inserted at the preset interval.
 47. The method of claim 38, wherein inserting a marker in the transport layer frame comprises inserting the marker within a header of the transport layer frame, and further comprising inserting a second marker in a data payload portion of the transport layer frame, the second marker point backwards to the framing header and being inserted at the preset interval.
 48. The method of claim 38, wherein inserting a marker in the transport layer frame comprises selecting a location in the transport layer frame at which to insert the marker, wherein said selecting comprises selecting between a plurality of locations comprising: between headers of the transport layer frame, within a header of the transport layer frame, and within a data payload portion of the transport layer frame.
 49. The method of claim 38, wherein the marker comprises: a first portion comprising information pointing backwards to the framing header; and a second portion comprising information different from the information of the first portion.
 50. The method of claim 49, wherein the second portion of the marker comprises framing information.
 51. The method of claim 49, wherein the second portion of the marker comprises signaling information.
 52. The method of claim 49, wherein the second portion of the marker comprises error correction information for correcting errors in the marker.
 53. The method of claim 49, wherein the second portion of the marker comprises ULP-specific information.
 54. The method of claim 38, wherein the marker comprises a delta value indicating a number of bytes before a marker location to a particular location within the framing header.
 55. The method of claim 38, wherein the marker comprises a delta value indicating a number of bytes before a marker location to a beginning location of the framing header.
 56. The method of claim 38, further comprising inserting at least one marker pointing backwards to a respective framing header in every transport layer frame of the transport layer byte stream.
 57. The method of claim 38, further comprising forming each transport layer frame of the transport layer byte stream to be self-descriptive.
 58. The method of claim 57, wherein forming each transport layer frame of the transport layer byte stream to be self-descriptive comprises forming each transport layer frame such that upper layer data carried by said transport layer frame is placed in a pre-designated memory location of a receiver of said transport layer frame, the memory location specific to the upper layer data, without requiring any other data, processing or information from other transport layer frames of the transport layer byte stream.
 59. The method of claim 57, wherein forming each transport layer frame of the transport layer byte stream to be self-descriptive comprises forming each transport layer frame such that upper layer data carried by said transport layer frame is placed in a pre-designated memory location of a receiver of said transport layer frame, the memory location specific to the upper layer data, independently of other transport layer frames of the transport layer byte stream.
 60. A method for locating a framing header in a received transport layer frame, the method comprising: receiving a transport layer frame of a transport layer byte stream, the transport layer frame comprising a transport layer header, a framing header immediately after the transport protocol header, and a backwards-pointing marker that points backwards to the framing header; locating the backwards-pointing marker in the received transport layer frame; and using information stored in the backwards-pointing marker to locate the framing header of the transport layer frame.
 61. A system for identifying ULP messages in a transport layer byte stream, the system comprising: a transmitter that operates to, at least: form a transport layer frame of the transport layer byte stream by, at least in part, attaching a framing header to a data payload of the transport layer frame, the framing header being attached at a location in the transport layer frame immediately after a transport protocol header of the transport layer frame; and insert a marker in the transport layer frame, the marker pointing backwards to the framing header and being inserted at a preset interval.
 62. A system for identifying ULP messages in a transport layer byte stream, the system comprising: a receiver that operates to, at least: receive a transport layer frame of a transport layer byte stream, the transport layer frame comprising a transport layer header, a framing header immediately after the transport protocol header, and a backwards-pointing marker that points backwards to the framing header; locate the backwards-pointing marker in the received transport layer frame; and use information stored in the backwards-pointing marker to locate the framing header of the transport layer frame. 